package com.geekaca.d05;

import java.util.ArrayList;
import java.util.List;

public class HelloForeach {
    public static void main(String[] args) {
        List<String> nameList = new ArrayList<>();
        nameList.add("张三丰");
        nameList.add("张无忌");
        nameList.add("小昭");
        for (String name : nameList) {
            System.out.println(name);

        }

        for (int i = 0; i < nameList.size(); i++) {
            nameList.set(i,"hello");
        }
        System.out.println(nameList);

    }
}
